package exception.demo02;

/**
 * @author IT_Jay
 * @date 2022/1/27 20:00
 */

//自定义异常类
public class MyException extends Exception{
    //传递数字   >10  抛出异常
    private int detail;

    public MyException(int a){
        this.detail = a;


    }
    //toString
    @Override
    public String toString() {      //打印异常信息
        return "MyException{" +
                "detail=" + detail +
                '}';
    }

}
